﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class UIPanal : MonoBehaviour 
{
	// Use this for initialization
	void Start () 
	{
		
	}

	public void creatDialog()
	{

	}

	public void closeDialog(string name)
	{
		for (int i = transform.childCount - 1; i >= 0; i--) 
		{
			if (transform.GetChild(i).name == name);
				Destroy(transform.GetChild(i).gameObject);
		}
	}

	public void clearAllDialog()
	{
		for (int i = transform.childCount - 1; i >= 0; i--) 
		{
			Destroy(transform.GetChild(i).gameObject);
		}
	}
	
	// Update is called once per frame
	void Update () 
	{
		
	}
}
